﻿/** Entity class 
*@author Raymond
*@version 2012-04-01
*Modifications: Make code refactoring
Hold data single festival
It is a structure for single festival only
Actual festival defines at FestivalScnerio
//*********************************************/
package festival;

public class festival {
        /** ID for each festival is unique*/
        private int festivalID;
        private String description;
        private int SE;
        //constructor
        
        /**Come from festivalDatabase*/
        private festival[] festivalArr; 
        public int festivalArrLength;
        
        public festival(){
        	loadFestivalData();
        }
        
        public festival(int festivalID, String description, int SE) {
                super();
                this.festivalID = festivalID;
				this.description = description;
				this.SE = SE;
        }
        
        public int getFestivalID() {
                return festivalID;
        }

        
		
		public String getDecription() {
                return description;
        }
		
		 public int getSE() {
             return SE;
		 }
		 
        public void loadFestivalData() {
            festivalArr = new festival[3];
            festivalArrLength = festivalArr.length;
            
            /** 1st festival*/
            int iD1 = 0; /**  Note the 1st festival ID is zero!!!*/
            String festival1 = "Today is Christmas\n" + "Merry Christmas!!\n" 
								+ "Your christmas present is one SE value added!\n";
            int SE1 = 1; /**  SE is added*/
            
            /** 2nd festival*/
            int iD2=1;
            String festival2 = "Today is Chinese Lunnar New Year\n" + "Happy Chinese Lunnar New Year!!\n" 
								+ "Your have recevied 1 SE value for your red pocket!\n";
            int SE2 = 1;/**  SE is added*/

			/**3rd festival*/
            int iD3=2;
            String festival3 = "Today is Chinese Ghost Festival\n" + "Be careful!!\n" 
								+ "Your has been scared in this festival and one SE value will be deducted!\n";
            int SE3 = -1; /** SE is deducted*/
            
            festivalArr[0] = new festival(iD1, festival1, SE1);
            festivalArr[1] = new festival(iD2, festival2, SE2);
            festivalArr[2] = new festival(iD3, festival3, SE3);
    }

    public festival getfestival(int diceResult) {
            return festivalArr[diceResult-1];
    }
    
}